﻿@{
    var str = Convert.ToInt32(ViewBag.CurrentPage) > 1 ? $"(第{ViewBag.CurrentPage}页)" : "";
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewData["Title"] = Model.Title + str + "-站点分类-一起牛";
    ViewData["keywords"] = Model.Keywords;
    ViewData["Description"] = Model.Description;
}
@model ArticleListPageVM
@section css{
    <link href="~/css/PagedList.min.css" rel="stylesheet" asp-append-version="true" />
}

    <div class="lbox">
        <div class="whitebg lanmu">
            <h1>@Model.Title</h1>
            <p>@Model.Description</p>
        </div>
        <div class="whitebg bloglist">
            <h2 class="htitle">最新@(Model.Title)</h2>
            @if (!string.IsNullOrEmpty(Model?.Title))
            {
                if (!Model.Title.Equals("网站模板"))
                {
                    <ul>
                        @foreach (var item in Model.ArticleList)
                        {
                            string detailUrl = domainConfig.CurrentValue.Host;
                            @if (string.IsNullOrEmpty(item.ParentColumnUrl))
                            {
                                detailUrl += $"/{item.EnTitle}/{item.Id}.html";
                            }
                            else
                            {
                                detailUrl += $"/{item.ParentColumnUrl}/{item.EnTitle}/{item.Id}.html";
                            }
                            <li>
                                <h3 class="blogtitle">
                                    <b>【@item.Hits】</b>
                                    <a href="@detailUrl" target="_blank" title="@item.Title">@item.Title</a>
                                </h3>
                                @if (!string.IsNullOrEmpty(item.ThumImg))
                                {
                                    <span class="blogpic imgscale">
                                        <i>
                                        </i>
                                        <a href="@detailUrl" title="@item.Title">
                                            @if (item.ThumImg.Contains(domainConfig.CurrentValue.ImgHost))
                                            {
                                                <img src="/image/loading.gif" alt="@item.Title" data-echo="@item.ThumImg" />
                                            }
                                            else
                                            {
                                                <img src="/image/loading.gif" alt="@item.Title" data-echo="@domainConfig.CurrentValue.ImgHost@item.ThumImg" />
                                            }
                                        </a>
                                    </span>
                                }
                                <p class="blogtext">@Html.Raw(item.Summary)</p>
                                <p class="bloginfo">
                                    <i class="avatar">
                                        <a href="@detailUrl" target="_blank" title="@item.Title">
                                            <img src="/image/avatar.jpg" border="0" width="30" height="30" alt="@item.Title">
                                        </a>
                                    </i>
                                    <span></span><span>@item.CreateTime</span><span>【<a href="@domainConfig.CurrentValue.Host@Url.Action("newslist", "home", new { parentColumnUrl = item.ParentColumnUrl, childColumnUrl = item.EnTitle })/" title="">@item.ColumnName</a>】</span>
                                </p>
                                <a href="@detailUrl" title="@item.Title" class="viewmore">阅读全文</a>
                            </li>
                        }
                    </ul>
                }
            }
            else
            {
                <div class="pics-list-price">
                    <ul>
                        @foreach (var item in Model.ArticleList)
                        {
                            string detailUrl = domainConfig.CurrentValue.Host;
                            @if (string.IsNullOrEmpty(item.ParentColumnUrl))
                            {
                                detailUrl += $"/{item.EnTitle}/{item.Id}.html";
                            }
                            else
                            {
                                detailUrl += $"/{item.ParentColumnUrl}/{item.EnTitle}/{item.Id}.html";
                            }
                            <li>
                                <section>
                                    <a href="@detailUrl" target="_blank">
                                        <i>原创</i><i>版权</i>
                                        @if (!string.IsNullOrEmpty(item.ThumImg))
                                        {
                                            <img src="@domainConfig.CurrentValue.ImgHost@item.ThumImg" alt="@item.Title">
                                        }
                                        else
                                        {
                                            <img src="https://mb.yangqq.com/d/file/templates/2020-03-16/791ac338839a069f6f7f17b38b66ae04.jpg" alt="@item.Title">
                                        }
                                    </a>
                                    <h2>@item.Title</h2>
                                    <span><a href="javascript:void(0)" target="_blank">预览</a><a href="@detailUrl" target="_blank">下载</a></span>
                                </section>
                            </li>
                        }
                    </ul>
                </div>
            }
            <div class="pagelist">
                @Html.Raw(ViewBag.PageHtml)
            </div>
        </div>
    </div>
    @await Component.InvokeAsync("Right", new { ColumnParentSpell = ViewBag.CurrentColumnUrl })